<!--
  @author heguanghua
  @since 2020/04/23 13:44
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead >
        <tr>
            <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
            <th lay-data="{field:'sort', width:60, unresize:true, align:'center', edit:'text'}" th:if="${hasModifySort}">排序</th>
            <th lay-data="{field:'sort', width:60, unresize:true, align:'center'}" th:if="${!hasModifySort}">排序</th>
            <th lay-data="{field:'roleId', width:80, unresize:true, align:'center'}">角色ID</th>
            <th lay-data="{field:'roleName', width:220, unresize:true, align:'left'}">角色名称</th>
            <th lay-data="{field:'type', width:110, unresize:true, align:'center'}">角色类型</th>
            <th lay-data="{field:'exportLimit', width:100, unresize:true, align:'center'}">数据导出上限</th>
            <th lay-data="{field:'dayLimit', width:100, unresize:true, align:'center'}">查询前溯天数</th>
            <th lay-data="{field:'remark', unresize:true, align:'left'}">备注说明</th>
            <th lay-data="{field:'status', width:90, unresize:true, align:'center'}">状态</th>
<!--            <th lay-data="{field:'updateTime', width:110, unresize:true, align:'center'}">修改日期</th>-->
            <th lay-data="{field:'操作', width:120, unresize:true, align:'center', fixed:'right'}"></th>
        </tr>
    </thead>
    <tbody>
        <tr th:each="item:${items}">
            <td></td>
            <td th:text="${item.sort}">sort</td>
            <td th:text="${item.roleId}">roleId</td>
            <td th:switch="${hasDetail}">
                <a th:lay-href="|${SYS_MCC}/role/detail.action?roleId=${item.roleId}|" th:lay-text="角色信息" th:text="${item.roleName}" th:case="true">roleName</a>
                <th:block th:text="${item.roleName}" th:case="*"></th:block>
            </td>
            <td th:text="${T(com.zmn.mcc.common.constant.RoleDict).roleTypeMap().get(item.type)}">type</td>
            <td th:text="${item.exportLimit == null ? '0' : item.exportLimit}">exportLimit</td>
            <td th:text="${item.dayLimit == null ? '0' : item.dayLimit}">dayLimit</td>
            <td th:text="${item.remark}">remark</td>
            <td th:switch="${hasModifyStatus}">
                <input type="checkbox" name="status" id="status" th:key="${item.roleId}" th:value="${item.status}" lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_status" th:checked="${item.status == 2}" th:case="true"/>
                <th:block th:text="${T(com.zmn.common.dictionary.GlobalDict).getStatus(item.status)}" th:case="*">status</th:block>
            </td>
<!--            <td th:text="${T(com.zmn.common.utils.date.DateUtil).subDate(item.updateTime)}">updateTime</td>-->
            <td>
                <a th:lay-href="|${SYS_MCC}/role/detail.action?roleId=${item.roleId}|" class="layui-btn layui-btn-xs layui-btn-primary" lay-text="角色信息" th:if="${hasDetail}"><i class="layui-icon">&#xe642;</i>详情</a>
                <a th:lay-href="|${SYS_MCC}/role/permit/tree.action?roleId=${item.roleId}|" class="layui-btn layui-btn-xs layui-btn-primary" lay-text="权限分配" th:if="${hasPermitTree}">权限</a>
            </td>
        </tr>
    </tbody>
</table>
